package com.adee.primary.t01_arr;

import java.util.HashMap;
import java.util.Map;

public class T004 {
    public static void main(String[] args) {
        int[] arr = new int[]{3,3,8,9,1,1,1,7};
        int[] arr1 = new int[]{3,8,9,1,7};
        System.out.println(containsDuplicate(arr1));
    }

    public static boolean containsDuplicate(int[] arr) {
        Map<Integer,Integer> map = new HashMap<>();
        for (int i : arr) {
            if (!map.containsKey(i)) {
                map.put(i, 1);
            } else {
                return true;
            }
        }
        return false;
    }
}
